package ServerPackge;

import java.util.HashMap;
import java.util.Map;

public class Mapper {

    private Map<String, Host> hostMap;

    private Map<String, Map<String, HttpServlet>> content2Wrapper = new HashMap<>();
    private Map<String, String> resourcesMap = new HashMap<>();

    public void putServletMap(String key, Map<String, HttpServlet> value){
        content2Wrapper.put("/"+key, value);
    }

    public Map<String, HttpServlet> getServletMap(String key){
        return content2Wrapper.get(key);
    }

    public void putResourcesMap(String key, String value){
        resourcesMap.put("/"+key, value);
    }

    public Mapper(){

    }

    public Mapper(Map<String, Host> hostMap) {
        this.hostMap = hostMap;
    }

    public String getResourcesPath(String key){
        return resourcesMap.get(key);
    }

    public Map<String, Host> getHostMap() {
        return hostMap;
    }

    public void setHostMap(Map<String, Host> hostMap) {
        this.hostMap = hostMap;
    }
}
